const http = require('http')
const server = http.createServer()

server.on("request",function(req,res){
    // req.url是客户端请求的URL地址
    const url = req.url;
    // req.method是客户端请求的method类型
    const method = req.method;
    const str = `Your request url is ${url}, and request method is ${method}`;
    console.log(str) // Your request url is /, and request method is GET
    // 在http://127.0.0.1/index.html url就是 /index.html
    
})

server.listen(80,()=>{
    console.log("server running at http://127.0.0.1")
})